home *** CD-ROM | disk | FTP | other *** search
- Path: keats.ugrad.cs.ubc.ca!not-for-mail
- From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
- Newsgroups: comp.lang.c
- Subject: Re: strange behaviour of doubles
- Date: 4 Mar 1996 10:34:22 -0800
- Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
- Message-ID: <4hfd3eINNt50@keats.ugrad.cs.ubc.ca>
- References: <1996Mar4.014052.6236@dcs.warwick.ac.uk>
- NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
-
- In article <1996Mar4.014052.6236@dcs.warwick.ac.uk>,
- Daniel Castillo Molero <D.C.Molero@dcs.warwick.ac.uk> wrote:
- > scanf("%g", &y);
- > printf("%g %g\n", x, y);
- > scanf("%g", &x);
-
- You are lying to scanf(). You tell it to expect two float pointers, and then
- feed it pointers to double.
-
- Change that to "%lg" and you should be ok.
- --
-
-